package com.app.micaihu.bean.news;

import android.text.TextUtils;

import com.app.micaihu.R;
import com.app.micaihu.app.AppApplication;
import com.app.micaihu.bean.infor.GetTaskBean;
import com.app.micaihu.configure.URIContant;
import com.app.utils.util.LogUtils;

import java.io.Serializable;

/**
 * 分享类
 * Created by linkai on 2016/7/19.
 */
public class ShareBean extends GetTaskBean implements Serializable {

    private String shareTitle;// 标题
    private String shareSummary;// 描述
    private String shareUrl;// 分享的文章url
    private String shareImg;// 分享的文章图标
    private String shareWxurl;// 分享的文章url 微信
    protected String shareType;//分享类型
    protected String articleId;//分享文章ID
    private String authorHeadPic;//作者头像
    private String authorId;//作者id
    private String authorName;//作者昵称

    public String getShareTitle() {
        return shareTitle;
    }

    /**
     * 获取分享的标题
     *
     * @param defaultTitle
     * @return
     */
    public String getShareTitle(String defaultTitle) {
        if (TextUtils.isEmpty(shareTitle)) {
            if (TextUtils.isEmpty(defaultTitle)) {
                defaultTitle = AppApplication.getInstance().getString(R.string.app_name);
            }
            return defaultTitle;
        }
        return shareTitle;
    }

    public void setShareTitle(String shareTitle) {
        this.shareTitle = shareTitle;
    }

    public String getShareSummary() {
        if (TextUtils.isEmpty(this.shareSummary)) {
            this.shareSummary = AppApplication.getInstance().getString(R.string.app_name);
        }
        return shareSummary;
    }

    public void setShareSummary(String shareSummary) {
        this.shareSummary = shareSummary;
    }

    public String getShareUrl() {
        if (TextUtils.isEmpty(shareUrl)) {
            shareUrl = URIContant.PROMOTIONPAGE;
        }
        return shareUrl;
    }

    public void setShareUrl(String shareUrl) {
        this.shareUrl = shareUrl;
    }

    public String getShareImg() {
        if (TextUtils.isEmpty(this.shareImg)) {
            this.shareImg = URIContant.SHARE_LOGO;
        }
        return shareImg;
    }

    public void setShareImg(String shareImg) {
        this.shareImg = shareImg;
    }

    public String getShareWxurl() {
        if (TextUtils.isEmpty(shareWxurl)) {
            shareWxurl = getShareUrl();
        }

        return shareWxurl;
    }

    public void setShareWxurl(String shareWxurl) {
        this.shareWxurl = shareWxurl;
    }

    public String getArticleId() {
        return articleId;
    }

    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }


    public String getShareType() {
        return shareType;
    }

    public void setShareType(String shareType) {
        this.shareType = shareType;
    }

    public String getAuthorHeadPic() {
        return authorHeadPic;
    }

    public void setAuthorHeadPic(String authorHeadPic) {
        this.authorHeadPic = authorHeadPic;
    }

    public String getAuthorId() {
        return authorId;
    }

    public void setAuthorId(String authorId) {
        this.authorId = authorId;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }
}
